package com.flying.scorer.score.equity.quarterlyreport;


import com.flying.refdata.model.equity.EquityInfo;
import com.flying.refdata.model.equity.QuarterlyReport;
import com.flying.refdata.service.ReportService;
import com.flying.scorer.score.ScoreException;

public class CashFlowGrowthRateEquityScorer extends AbstractQuarterlyReportScorer {
    public CashFlowGrowthRateEquityScorer(ReportService reportService) {
        super(reportService);
    }

    public double score(int date, EquityInfo info) throws ScoreException {
        QuarterlyReport qr = getQuarterlyReport(info, date);
        double rate = qr.getCashFlowGrowthRate();
        if (rate < 0) return 0;
        else if (rate < 5) return 1;
        else if (rate < 10) return 2;
        else if (rate < 15) return 3;
        else if (rate < 20) return 4;
        else return 5;
    }
}

